package demo1;

import java.util.Scanner;

public class Tert3 {
    //计算最后一个单词的长度
    public static int endLetterLength(String str) {

        //删除两边空格
        str = str.trim();
        //asdf sdf dfg  fgh
        int index = str.lastIndexOf(" ");
        System.out.println(index);
        str = str.substring(index + 1);
        return str.length();

    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        /*String str = "  asdf sdf dfg  fgh    ";
        String str1 = "asdf";
        int length = endLetterLength(str1);
        System.out.println(length);*/
        String str = in.next();
        str = str.trim();
        //asdf sdf dfg  fgh
        int index = str.lastIndexOf(" ");
        str = str.substring(index + 1);
        System.out.println(str.length());
    }
}
